package org.huntaway.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the sysmenu table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="sysmenu"
 */

public abstract class BaseSysmenu  implements Serializable {

	public static String REF = "Sysmenu";
	public static String PROP_CREATOR = "Creator";
	public static String PROP_SYS_MENU_ID = "SysMenuId";
	public static String PROP_CODE = "Code";
	public static String PROP_CREATE_DATE = "CreateDate";
	public static String PROP_NAME = "Name";
	public static String PROP_MENU_LINK = "MenuLink";
	public static String PROP_UPDATOR = "Updator";
	public static String PROP_MENU_PREFIX = "MenuPrefix";
	public static String PROP_MENU_TARGET = "MenuTarget";
	public static String PROP_INTRODUCTION = "Introduction";
	public static String PROP_MENU_ORDER = "MenuOrder";
	public static String PROP_ID = "Id";
	public static String PROP_UPDATE_DATE = "UpdateDate";
	public static String PROP_REMARK = "Remark";


	// constructors
	public BaseSysmenu () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSysmenu (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseSysmenu (
		java.lang.Integer id,
		java.lang.String name) {

		this.setId(id);
		this.setName(name);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer sysMenuId;
	private java.lang.String code;
	private java.lang.String name;
	private java.lang.String menuPrefix;
	private java.lang.String menuLink;
	private java.lang.String menuTarget;
	private java.lang.Integer menuOrder;
	private java.lang.String remark;
	private java.lang.String introduction;
	private java.util.Date createDate;
	private java.util.Date updateDate;
	private java.lang.String creator;
	private java.lang.String updator;

	// collections
	private java.util.Set<org.huntaway.po.Rolemenu> rolemenus;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: sys_menu_id
	 */
	public java.lang.Integer getSysMenuId () {
		return sysMenuId;
	}

	/**
	 * Set the value related to the column: sys_menu_id
	 * @param sysMenuId the sys_menu_id value
	 */
	public void setSysMenuId (java.lang.Integer sysMenuId) {
		this.sysMenuId = sysMenuId;
	}



	/**
	 * Return the value associated with the column: code
	 */
	public java.lang.String getCode () {
		return code;
	}

	/**
	 * Set the value related to the column: code
	 * @param code the code value
	 */
	public void setCode (java.lang.String code) {
		this.code = code;
	}



	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: menu_prefix
	 */
	public java.lang.String getMenuPrefix () {
		return menuPrefix;
	}

	/**
	 * Set the value related to the column: menu_prefix
	 * @param menuPrefix the menu_prefix value
	 */
	public void setMenuPrefix (java.lang.String menuPrefix) {
		this.menuPrefix = menuPrefix;
	}



	/**
	 * Return the value associated with the column: menu_link
	 */
	public java.lang.String getMenuLink () {
		return menuLink;
	}

	/**
	 * Set the value related to the column: menu_link
	 * @param menuLink the menu_link value
	 */
	public void setMenuLink (java.lang.String menuLink) {
		this.menuLink = menuLink;
	}



	/**
	 * Return the value associated with the column: menu_target
	 */
	public java.lang.String getMenuTarget () {
		return menuTarget;
	}

	/**
	 * Set the value related to the column: menu_target
	 * @param menuTarget the menu_target value
	 */
	public void setMenuTarget (java.lang.String menuTarget) {
		this.menuTarget = menuTarget;
	}



	/**
	 * Return the value associated with the column: menu_order
	 */
	public java.lang.Integer getMenuOrder () {
		return menuOrder;
	}

	/**
	 * Set the value related to the column: menu_order
	 * @param menuOrder the menu_order value
	 */
	public void setMenuOrder (java.lang.Integer menuOrder) {
		this.menuOrder = menuOrder;
	}



	/**
	 * Return the value associated with the column: remark
	 */
	public java.lang.String getRemark () {
		return remark;
	}

	/**
	 * Set the value related to the column: remark
	 * @param remark the remark value
	 */
	public void setRemark (java.lang.String remark) {
		this.remark = remark;
	}



	/**
	 * Return the value associated with the column: introduction
	 */
	public java.lang.String getIntroduction () {
		return introduction;
	}

	/**
	 * Set the value related to the column: introduction
	 * @param introduction the introduction value
	 */
	public void setIntroduction (java.lang.String introduction) {
		this.introduction = introduction;
	}



	/**
	 * Return the value associated with the column: create_date
	 */
	public java.util.Date getCreateDate () {
		return createDate;
	}

	/**
	 * Set the value related to the column: create_date
	 * @param createDate the create_date value
	 */
	public void setCreateDate (java.util.Date createDate) {
		this.createDate = createDate;
	}



	/**
	 * Return the value associated with the column: update_date
	 */
	public java.util.Date getUpdateDate () {
		return updateDate;
	}

	/**
	 * Set the value related to the column: update_date
	 * @param updateDate the update_date value
	 */
	public void setUpdateDate (java.util.Date updateDate) {
		this.updateDate = updateDate;
	}



	/**
	 * Return the value associated with the column: creator
	 */
	public java.lang.String getCreator () {
		return creator;
	}

	/**
	 * Set the value related to the column: creator
	 * @param creator the creator value
	 */
	public void setCreator (java.lang.String creator) {
		this.creator = creator;
	}



	/**
	 * Return the value associated with the column: updator
	 */
	public java.lang.String getUpdator () {
		return updator;
	}

	/**
	 * Set the value related to the column: updator
	 * @param updator the updator value
	 */
	public void setUpdator (java.lang.String updator) {
		this.updator = updator;
	}



	/**
	 * Return the value associated with the column: Rolemenus
	 */
	public java.util.Set<org.huntaway.po.Rolemenu> getRolemenus () {
		return rolemenus;
	}

	/**
	 * Set the value related to the column: Rolemenus
	 * @param rolemenus the Rolemenus value
	 */
	public void setRolemenus (java.util.Set<org.huntaway.po.Rolemenu> rolemenus) {
		this.rolemenus = rolemenus;
	}

	public void addToRolemenus (org.huntaway.po.Rolemenu rolemenu) {
		if (null == getRolemenus()) setRolemenus(new java.util.TreeSet<org.huntaway.po.Rolemenu>());
		getRolemenus().add(rolemenu);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.po.Sysmenu)) return false;
		else {
			org.huntaway.po.Sysmenu sysmenu = (org.huntaway.po.Sysmenu) obj;
			if (null == this.getId() || null == sysmenu.getId()) return false;
			else return (this.getId().equals(sysmenu.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}